#ifndef FS_ID_POOL_H
#define FS_ID_POOL_H

#include <vector>
using namespace std;

// Used a template for this class from: www.yolinux.com/TUTORIALS/C++Singleton.html
class fs_IDPool {

public:
	static fs_IDPool *Instance();
	unsigned int getID();
	void releaseID(unsigned int ID);
	static void Destroy();

private:
	static fs_IDPool *m_instance;

	fs_IDPool() {freeIDs = new vector<unsigned int>;};
	fs_IDPool(fs_IDPool const&) {};
	fs_IDPool& operator=(fs_IDPool const&) {};

	~fs_IDPool() {delete freeIDs;};

	vector<unsigned int> *freeIDs;
};

#endif // #ifndef FS_ID_POOL_H